package com.service.auth.serviceauth.controller;

import java.security.Principal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UserController {

  Logger logger = LoggerFactory.getLogger(UserController.class);

  @RequestMapping(value = "/current", method = RequestMethod.GET)
  public Principal getUser(Principal principal) {
    logger.info(">>>>>>>>>>>>>>>>>>>>>>>>");
    logger.info(principal.toString());
    logger.info(">>>>>>>>>>>>>>>>>>>>>>>>");
    return principal;
  }
}
